home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / cug231 / interp.h < prev    next >
Text File  |  1987-06-17  |  1KB  |  41 lines

  1. /*
  2.         Little Smalltalk interpeter definitions
  3. */
  4. /*
  5.     for interpreters
  6.         t_size = INTERPSIZE
  7.          
  8.         creator is a pointer to the interpreter which created
  9.         the current interpreter.  it is zero except in the case
  10.         of blocks, in which case it points to the creating
  11.         interpreter for a block.  it is NOT a reference, ie,
  12.         the ref_count field of the creator is not incremented when
  13.         this field is set - this avoids memory reference loops.
  14.  
  15.         stacktop is a pointer to a pointer to an object, however it
  16.         is not considered a reference.   ie, changing stacktop does
  17.         not alter reference counts.
  18. */
  19.  
  20. struct interp_struct {
  21.         int    t_ref_count;
  22.     int    t_size;    /* should always be INTERPSIZE */
  23.     struct interp_struct *creator;
  24.     struct interp_struct *sender;
  25.     object     *bytecodes;
  26.     object    *receiver;
  27.     object  *literals;
  28.     object    *context;
  29.     object  *stack;
  30.     object    **stacktop;
  31.     uchar   *currentbyte;
  32.         };
  33.  
  34. typedef struct interp_struct interpreter;
  35.  
  36. extern interpreter *cr_interpreter();
  37.  
  38. extern object *o_drive;
  39.  
  40. # define is_driver(x) (o_drive == (object *) x)
  41.